import React from 'react';
import { C7NStatusTag as StatusTag } from '@zknow/components';

const renderStatus = ({ value }:{value:boolean}) => (
  <StatusTag
    name={value ? '启用' : '停用'}
    colorCode={value ? 'success' : 'deleted'}
  />
);

const columns = [
  {
    name: 'realName',
  },
  {
    name: 'loginName',
  },
  {
    name: 'enabled',
    align: 'left' as any,
    width: 150,
    renderer: renderStatus,
  },
  {
    name: 'ldap',
    align: 'left' as any,
    width: 150,
    renderer: ({ value }:{value:string}) => (value ? 'LDAP用户' : '非LDAP用户'),
  },
];

export { columns };
